<template>
 <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
    <div id="myEchart" style="width: 600px;height:400px;"></div>
</template>

<script>
import { get } from '../../assets/http.js'
export default {
  name: 'MemberManage',
  data () {
    return {
    }
  },
  mounted () {
    // 初始化报表
    this.setReport()
  },
  methods: {
    async setReport () {
      // 查询会员增长趋势
      let echart = this.$echarts.init(document.getElementById('myEchart'))
      // get请求获取数据 七天的日期  订单的销量
      var res = await get('store/getGrowth', {store_id: this.$route.query.store_id})
      if (res.flag) {
        echart.setOption({
          title: { text: '会员增长信息表' },
          xAxis: {
            show: true,
            data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
            name: '日期',
            nameTextStyle: {
              fontWeight: 'normal',
              fontSize: '18'
            }
          },
          yAxis: {},
          series: [{
            name: '销量',
            type: 'line',
            data: [5, 20, 36, 10, 10, 20]
          }]

        })
      } else {
        this.$message.error('网络拥堵哦')
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
</style>
